<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <title>Core example -- double underscore</title>
  <link rel="stylesheet" type="text/css" href="../example.css" />
</head>
<body>
<div id="doc4">
  <div class="hd">
    <div class="logo" style="float:left;"><a href="http://code.google.com/p/double-underscore/" target="_blank"><img src="http://stauren.net/misc/images/bullhead.gif" /></a></div>
    <div class="hd-title">Core util example:</div>
    <div>
      <a href="http://code.google.com/p/double-underscore/">Project home</a>&nbsp;
      <a href="http://code.google.com/p/double-underscore/w/list">More docs </a>
    </div>
  </div>

  <div class="hd">
    <h1>Example:Drag and drop, ajax loading</h1>
    <div id="drageTest" style="position:relative;background:#b3a;cursor:move;width:100px;height:100px;">drag me</div>
    <h1>Code</h1>
<pre>
&lt;script src="http://double-underscore.googlecode.com/svn/trunk/src/loader/loader.js"&gt;&lt;/script&gt;
//NOTICE: loader.js in trunk is not stable, should always use the newest loader in pkgs

&lt;script&gt;
__.load('core', function() {

  //code here

});
&lt;/script&gt;
</pre>
    <h1>Complete Code</h1>
<pre>
__.load('core', function() {
  __.debug();
  __.onReady(function () {
    dolog('core loaded.');
  });

  __.Drag.bind('drageTest', true, {
    t : 150, r : 400, b : 0, l :0
  }, function(left, top, zone) {
    dolog('Drag stopped at x:'+left+', y:'+top);
  });

  __.Io.ajax('./2.txt', {onSuccess:function(o) {
    dolog('ajax load result: '+ o);
  }});

  //a 20 ajax manager loading stack
  __.Lang.each(__.Lang.range(20), function(i) {
    __.Io.p('./result.php', function(o) {
      dolog('pending ajax '+ i +' result: '+ o);
    });
  });

});
</pre>
  </div>
</div>
<script src="../example.js"></script>
<script src="http://double-underscore.googlecode.com/svn/trunk/src/loader/loader.js"></script>
<script>
__.load('core', function() {
  __.debug();
  __.onReady(function () {
    dolog('core loaded.');
  });

  __.Drag.bind('drageTest', true, {
    t : 150, r : 400, b : 0, l :0
  }, function(left, top, zone) {
    dolog('Drag stopped at x:'+left+', y:'+top);
  });

  __.Io.ajax('./2.txt', {onSuccess:function(o) {
    dolog('ajax load result: '+ o);
  }});

  //a 20 ajax manager loading stack
  __.Lang.each(__.Lang.range(20), function(i) {
    __.Io.p('./result.php', function(o) {
      dolog('pending ajax '+ i +' result: '+ o);
    });
  });

});
</script>
</body>
</html>
